package com.atiguigu.spring6.validator.three;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestMethodDemo {

    @Test
    public void testMethod(){
        ApplicationContext context = new AnnotationConfigApplicationContext(ValidationConfig.class);
        MyService bean = context.getBean(MyService.class);
        User user = new User();
        user.setAge(1);
        user.setName("aaa");
        user.setEmail("aaa@qq.com");
        user.setMessage(" 你好");
        bean.testMethod(user);
    }
}
